package com.liveinstars.api.facade;


import com.liveinstars.api.dto.InterestDetailDto;
import com.liveinstars.api.dto.InterestDto;
import com.liveinstars.api.dto.InterestSimpleDto;
import com.liveinstars.api.dto.JoinInterest;
import com.liveinstars.api.query.InterestQuery;
import com.onepiece.shipelves.common.Result;
import com.onepiece.shipelves.common.vo.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@FeignClient("quhui")
public interface IInterestApi {

    /**
     * 获取分页
     * @param query
     * @return
     */
    @GetMapping("/quhui/interest/pageByQuery")
    Result<Page<InterestDto>> pageByQuery(@RequestBody InterestQuery query);

    /**
     * 查询全部兴趣无其他表字段
     * @return
     */
    @GetMapping("/quhui/interest/getInterests")
    Result<List<InterestSimpleDto>> getInterests();

    /**
     * 查询兴趣包含人数等附加字段
     * @param userId
     * @return
     */
    @GetMapping("/quhui/interest/getMyInterests")
    Result<List<InterestDto>> getMyInterests(@RequestParam(value = "user_id") Integer userId);

    /**
     * 查询兴趣不包含其他表字段
     * @param userId
     * @return
     */
    @GetMapping("/quhui/interest/getMyInterestsSimple")
    Result<List<InterestSimpleDto>> getMyInterestsSimple(@RequestParam(value = "user_id") Integer userId);

    @GetMapping("/quhui/interest/getDetailById")
    Result<InterestDetailDto> getDetailById(@RequestParam(value = "id") Integer id);

    @PostMapping("/quhui/interest/joinInterest")
    Result<Boolean> joinInterest(@RequestBody JoinInterest dto, @RequestHeader("uid") Integer userId);



}
